import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/receipt_address_entity.dart';

ReceiptAddressEntity $ReceiptAddressEntityFromJson(Map<String, dynamic> json) {
	final ReceiptAddressEntity receiptAddressEntity = ReceiptAddressEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		receiptAddressEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		receiptAddressEntity.msg = msg;
	}
	final List<ReceiptAddressData>? data = jsonConvert.convertListNotNull<ReceiptAddressData>(json['data']);
	if (data != null) {
		receiptAddressEntity.data = data;
	}
	return receiptAddressEntity;
}

Map<String, dynamic> $ReceiptAddressEntityToJson(ReceiptAddressEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	return data;
}

ReceiptAddressData $ReceiptAddressDataFromJson(Map<String, dynamic> json) {
	final ReceiptAddressData receiptAddressData = ReceiptAddressData();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		receiptAddressData.id = id;
	}
	final String? userId = jsonConvert.convert<String>(json['user_id']);
	if (userId != null) {
		receiptAddressData.userId = userId;
	}
	final String? username = jsonConvert.convert<String>(json['username']);
	if (username != null) {
		receiptAddressData.username = username;
	}
	final String? mobile = jsonConvert.convert<String>(json['mobile']);
	if (mobile != null) {
		receiptAddressData.mobile = mobile;
	}
	final String? province = jsonConvert.convert<String>(json['province']);
	if (province != null) {
		receiptAddressData.province = province;
	}
	final String? city = jsonConvert.convert<String>(json['city']);
	if (city != null) {
		receiptAddressData.city = city;
	}
	final String? area = jsonConvert.convert<String>(json['area']);
	if (area != null) {
		receiptAddressData.area = area;
	}
	final String? detail = jsonConvert.convert<String>(json['detail']);
	if (detail != null) {
		receiptAddressData.detail = detail;
	}
	final String? isDefault = jsonConvert.convert<String>(json['is_default']);
	if (isDefault != null) {
		receiptAddressData.isDefault = isDefault;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		receiptAddressData.createdAt = createdAt;
	}
	final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
	if (updatedAt != null) {
		receiptAddressData.updatedAt = updatedAt;
	}
	final String? provinceName = jsonConvert.convert<String>(json['province_name']);
	if (provinceName != null) {
		receiptAddressData.provinceName = provinceName;
	}
	final String? cityName = jsonConvert.convert<String>(json['city_name']);
	if (cityName != null) {
		receiptAddressData.cityName = cityName;
	}
	final String? areaName = jsonConvert.convert<String>(json['area_name']);
	if (areaName != null) {
		receiptAddressData.areaName = areaName;
	}
	return receiptAddressData;
}

Map<String, dynamic> $ReceiptAddressDataToJson(ReceiptAddressData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['user_id'] = entity.userId;
	data['username'] = entity.username;
	data['mobile'] = entity.mobile;
	data['province'] = entity.province;
	data['city'] = entity.city;
	data['area'] = entity.area;
	data['detail'] = entity.detail;
	data['is_default'] = entity.isDefault;
	data['created_at'] = entity.createdAt;
	data['updated_at'] = entity.updatedAt;
	data['province_name'] = entity.provinceName;
	data['city_name'] = entity.cityName;
	data['area_name'] = entity.areaName;
	return data;
}